﻿<%@ Page Language="C#" AutoEventWireup="true" validaterequest="false" CodeBehind="edit.aspx.cs" Inherits="AnyOffice.general.news.manage.edit" %>
<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>编辑简报</title>
		
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
		<script src="/module/date_selector/popcalendar.js"></script>
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript" type="text/javascript">		
		function CheckForm() {

		    if (document.getElementById("ddlTypeId").length == 1) {
		        alert("请先定义简报类型！");
		        return (false);
		    }
			

			if (document.Form1.txtSubject.value=="")
			{
				alert("简报的标题不能为空！");
				document.Form1.txtSubject.focus();
				return (false);
			}
			
			if (document.getElementById("ddlTypeId").value == "")
			{
				alert("请选择简报类型！");
				return (false);
			}

           if (document.getElementById("ToId").value == "") {
                alert("请指定审核人员！");
                return (false);
            }
			   
			var oEditor = FCKeditorAPI.GetInstance('txtContent');
			if(oEditor.GetHTML() == "")  
			{
				alert("简报的内容不能为空！");
				return (false);
			}
			return true;
		}

		function CheckFile()
		{
			if (document.Form1.fileAttach.value=="")
			{
				alert("请选择附件！");
				return (false);
			}   
			return true;	
		}		
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
         <div class="main_div">
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="90%" border="0">
					<TR>
						<TD class="Big"><IMG src="/images/edit.gif" align="absMiddle" width="20" height="20"><SPAN class="big3"> 
								编辑简报</SPAN>
						</TD>
					</TR>
				</TABLE>
				<br>
				<TABLE class="small" cellSpacing="1" cellPadding="2" width="90%" align="center" border="0" bgcolor="#000000">
				<%--	<TR>
						<TD class="TableData">发布范围（部门）：</TD>
						<TD class="TableData"><INPUT id="ToId" type="hidden" name="ToId" runat="server"> 
                            <TEXTAREA class="BigStatic" id="ToName" name="ToName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="添加部门" onclick="dept_select('ToId','ToName','');" type="button" value="添 加"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空部门" onclick="clear_double('ToId','ToName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData">发布范围（角色）：</TD>
						<TD class="TableData"><INPUT id="ToPriv" type="hidden" name="ToPriv" runat="server"> 
                            <TEXTAREA class="BigStatic" id="ToPrivName" name="ToPrivName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="选择角色" onclick="priv_select('ToPriv','ToPrivName','');" type="button" value="选 择"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空角色" onclick="clear_double('ToPriv','ToPrivName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData">发布范围（人员）：</TD>
						<TD class="TableData"><INPUT id="ToUser" type="hidden" name="ToUser" runat="server"> 
                            <TEXTAREA class="BigStatic" id="ToUserName" name="ToUserName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="选择人员" onclick="user_select('ToUser','ToUserName','');" type="button" value="选 择"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空人员" onclick="clear_double('ToUser','ToUserName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>--%>
					<TR>
						<TD class="TableData" noWrap>标题：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtSubject" runat="server" CssClass="BigInput" MaxLength="200" Columns="40"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>类型：</TD>
						<TD class="TableData"><asp:DropDownList id="ddlTypeId" runat="server" CssClass="BigSelect" DataValueField="TypeId" DataTextField="TypeName"></asp:DropDownList></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>附件：</TD>
						<TD class="TableData">
							<asp:Panel id="pnlAttach" runat="server" Visible="False">
								<asp:ListBox id="ltbFileList" runat="server" Rows="1"></asp:ListBox>
								<asp:button id="btnRemoveFile" runat="server" CssClass="SmallButton" Text="删除" onclick="btnRemoveFile_Click"></asp:button>
							</asp:Panel></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>附件上传：</TD>
						<TD class="TableData"><INPUT class="SmallInput" id="fileAttach" type="file" size="26" name="fileAttach" runat="server">
							<asp:button id="btnAddFile" runat="server" CssClass="SmallButton" Text="添加" onclick="btnAddFile_Click"></asp:button></TD>
					</TR>
                    	<TR>
						<TD class="TableData">审核人员：</TD>
						<TD class="TableData"><INPUT id="ToId" type="hidden" name="ToId" runat="server"> <TEXTAREA class="BigStatic fl" id="ToName" name="ToName" rows="2" readOnly wrap="yes" cols="40"
								runat="server"></TEXTAREA><INPUT class="bnt_Choice fl" style="width:50px; display:inline-table;" title="选择人员" onClick="user_select('ToId','ToName','');" type="button"
								value="选择" name="button"><INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('ToId','ToName');" type="button"
								value="清空" name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>提醒：</TD>
						<TD class="TableData">
							<asp:CheckBox id="ckbSms" runat="server" Text="使用内部短信提醒用户" Checked="False"></asp:CheckBox>
							<asp:CheckBox id="ckbMobile" runat="server" Visible="False" Text="使用手机短信提醒用户"></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>详细内容：</TD>
						<TD class="TableData" colSpan="1">
							<FCKeditorV2:FCKeditor id="txtContent" runat="server" Width="100%"  Height="350px"></FCKeditorV2:FCKeditor>
						</TD>
					</TR>
					<TR class="TableControl" align="center">
						<TD noWrap colSpan="2">
							<asp:Button id="btnSubmit" runat="server" CssClass="BigButton" Text="发布" onclick="btnSubmit_Click"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;
							<INPUT class="BigButton" onclick="location='index1.aspx?type_id=<%=ViewState["TypeId"]%>&page=<% = ViewState["CurrentPage"] %>'" type="button" value="返回">
						</TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
			<br>
			<br>
            </div>
		</form>
	</body>
</HTML>
